<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Generator Data Model</title>
<title>CMSIS-Zone (Preview): Generator Data Model</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="printComponentTabs.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 46px;">
  <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">CMSIS-Zone (Preview)
   &#160;<span id="projectnumber">Version 0.0.1</span>
   </div>
   <div id="projectbrief">System Resource Management</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
    <ul class="tablist">
      <script type="text/javascript">
		<!--
		writeComponentTabs.call(this);
		//-->
      </script>
	  </ul>
</div>
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('GenDataModel.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Generator Data Model </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The <b>Generator Data Model</b> defines the view on the <b>Zone Description</b> for code generators. By defining a common data model code generators can be developed independendly from actual CMSIS Zone Projects and vendor tools.</p>
<p>The CMSIS-Zone data (structured according to the Generator Data Model) is combined with file templates using the FreeMarker template engine to generate arbitrary project files, see picture below..</p>
<div class="image">
<img src="generator.png" alt="generator.png"/>
<div class="caption">
FreeMarker Template Engine</div></div>
 <h1><a class="anchor" id="GenDataModel_Structure"></a>
Data Model Structure</h1>
<p>The class diagram below visualizes the overall structure of the <b>Generator Data Model</b>. The root element visible to the templates is FmZone.</p>
<div class="image">
<img src="genmodel.png" alt="genmodel.png"/>
<div class="caption">
Generator Data Model Class Diagram</div></div>
<p> According to <a href="http://freemarker.org/docs/index.html" target="_blank">FreeMarker Documentation</a> one can access the named attributes like <a href="http://freemarker.org/docs/dgui_template_exp.html#dgui_template_exp_var_hash" target="_blank">retrieving data from a hash</a>. The reference implementation documented in detail below make use of the default FreeMarker <a href="http://freemarker.org/docs/pgui_misc_beanwrapper.html" target="_blank">Bean wrapper</a>. This leads to all Java methods named like <em>get&lt;Attribute&gt;</em> or <em>is&lt;Attribute&gt;</em> to be visible just as <em>&lt;Attribute&gt;</em> to the template.</p>
<p>Please take note about the multiplicities stated in the diagram:</p>
<ul>
<li>0..1 indicates an optional value which might be unavailable, consider using <a href="http://freemarker.org/docs/dgui_template_exp.html#dgui_template_exp_missing" target="_blank">missing value handler operators</a>.</li>
<li>1 indicates a mandatory value which is guaranteed to be valid.</li>
<li>0..* indicates a collection or hash of values which might be empty.</li>
<li>1..* indicates a collection or hash of values which is guaranteed to contain at least one element.</li>
</ul>
<p>For detailed descriptions of the data model elements please refere to the <a href="../genmodel/index.html" target="_blank">JavaDoc</a> documentation for</p>
<ul>
<li><a href="../genmodel/com/arm/cmsis/zone/gen/data/FmZone.html" target="_blank">FmZone</a></li>
<li><a href="../genmodel/com/arm/cmsis/zone/gen/data/FmProcess.html" target="_blank">FmProcess</a></li>
<li><a href="../genmodel/com/arm/cmsis/zone/gen/data/FmDevice.html" target="_blank">FmDevice</a></li>
<li><a href="../genmodel/com/arm/cmsis/zone/gen/data/FmProcessor.html" target="_blank">FmProcesor</a></li>
<li><a href="../genmodel/com/arm/cmsis/zone/gen/data/FmBlock.html" target="_blank">FmBlock</a></li>
</ul>
<h1><a class="anchor" id="GenDataModel_Examples"></a>
Template Examples</h1>
<p>To get an impression of how template files might look like please refere to the simplyfied examples in this section.</p>
<h2><a class="anchor" id="GenDataModel_Examples_AssignedBlocks"></a>
HTML table of all assigned memory blocks</h2>
<p>This examples demonstrates how to iterate over the collection of memory blocks assigned to the project zone currently evaluated. The result of the template below is a HTML table with three columns listing block name, start address and size, respectively.</p>
<div class="fragment"><div class="line">&lt;table&gt;</div>
<div class="line">  &lt;th&gt;</div>
<div class="line">    &lt;td&gt;Name&lt;/td&gt;</div>
<div class="line">    &lt;td&gt;Start&lt;/td&gt;</div>
<div class="line">    &lt;td&gt;Size&lt;/td&gt;</div>
<div class="line">  &lt;/th&gt;</div>
<div class="line">&lt;#list blocks as block&gt;</div>
<div class="line">  &lt;tr&gt;</div>
<div class="line">    &lt;td&gt;${block.name}&lt;/td&gt;</div>
<div class="line">    &lt;td&gt;${block.start}&lt;/td&gt;</div>
<div class="line">    &lt;td&gt;${block.size}&lt;/td&gt;</div>
<div class="line">  &lt;/tr&gt;</div>
<div class="line">&lt;/#list&gt;</div>
<div class="line">&lt;/table&gt;</div>
</div><!-- fragment --> </div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Wed Aug 1 2018 17:12:47 for CMSIS-Zone (Preview) by Arm Ltd. All rights reserved.
	<!--
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 
	-->
	</li>
  </ul>
</div>
</body>
</html>
